home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
-
- SoundPlay.c
- Last Modified: Friday, May 31, 1991 at 9:46 PM
-
- Attempt to play all 'snd ' resources given text for each
- line selected (or all text if no selection)
-
- © Copyright Evatac Software 1988-1990
- All rights reserved
-
- ************************************************************/
-
- #include "PCMD.h"
- #include <Resources.h>
- #include <Memory.h>
- #include <Sound.h>
-
- main(
- unsigned char *sourceText,
- long sourceLength,
- unsigned char *destText,
- long *destSpace,
- PCMDInfo *info
- )
- {
- #pragma unused(destText)
- #pragma unused(destSpace)
- #pragma unused(info)
-
- Handle theSound;
- char soundName[34];
-
- if (sourceLength > 31)
- sourceLength = 31;
- BlockMove(sourceText, soundName + 1, sourceLength);
- *soundName = (char) sourceLength;
-
- theSound = GetNamedResource('snd ', soundName);
- if (theSound != NULL) {
- SndPlay(NULL, theSound, FALSE);
- ReleaseResource(theSound);
- }
- return(kPCMDSuccess);
- }
-